<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>员工列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%@include file="/common/header.jsp"%>
    
</head>
<script type="text/javascript">
    function goPage(currentPage){
        if (currentPage != null) {
        	document.getElementById("currentPage").value = currentPage;
        	document.forms[0].submit();
        }	   
    }
</script>
<body>
    <div class="container " style="margin-top: 20px">
    <%@include file="/common/top.jsp"%>
    <div class="row">
        <div class="col-sm-3">
            <%@include file="/common/menu.jsp"%>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">员工列表</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="#" method="post">
                <a href="/employee?cmd=input" class="btn btn-success">添加员工</a>
                <br/><br/>

                <table class="table table-striped table-hover" >
                    <thead> 
                        <tr>
                            <th style="text-align: center;">序号</th>
                            <th style="text-align: center;">ID</th>
                            <th style="text-align: center;">名称</th>
                            <th style="text-align: center;">部门</th>
                            <th style="text-align: center;">操作</th>
                        </tr>
                    </thead>
                    <c:forEach items="${employees}" var="employee" varStatus="vs">
                    <tr style="text-align: center;">
                       <td>${vs.count}</td>
                       <td>${employee.id}</td>
                       <td>${employee.name}</td>
                       <td>${employee.department.name}</td>
                       <td>
                            <a href="/employee?cmd=input&id=${employee.id}">编辑 | </a>
                            <a href="/employee?cmd=delete&id=${employee.id}">删除 </a>
                       </td>
                    </tr>
                    </c:forEach>
                    
                </table>
                
            </form>
        </div>
    </div>
</div>
</body>
</html>